<template>
  <el-table :data="tableData" style="width: 100%" height="280px" :header-cell-style="{ 
      background:'#FFFFFF',color:'#000000'}">>
    <el-table-column prop="time" label="时间"> </el-table-column>
    <el-table-column prop="factoryName" label="公司名称"> </el-table-column>
    <el-table-column prop="address" label="地址"> </el-table-column>
    <el-table-column prop="name" label="报案人"> </el-table-column>
    <el-table-column prop="phone" label="联系电话"> </el-table-column>
    <el-table-column prop="accidentDetail" label="详情"> </el-table-column>
  </el-table>
</template>
  
<script>
import {getAccidentData} from "@/api/index/index"
export default {
  name: "AccidentTable",
  data() {
    return {
      tableData: [
        {
          time: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
      ],
    };
  },
  methods:{
    initData(){
      getAccidentData().then((res)=>{
        console.log(res);
        if(res.code==200){
          this.tableData = res.rows;
        }
      })
    }
  },
  mounted(){
    this.initData();
  }
};
</script>